Skip to content

Conversation

usu
Copy link
Member

@usu usu commented Jan 20, 2024

Otherwise this will throw an console error in vuex.
Haven't seen any negative side effects so far, but we should observe carefully.

+ running linter

@usu usu requested a review from carlobeltrame January 20, 2024 15:02
@@ -406,7 +406,11 @@ function HalJsonVuex (store: Store<Record<string, State>>, axios: AxiosInstance,
function setLoadPromiseOnStore (uri: string, loadStoreData: Promise<StoreData> | null = null) {
const promise: SerializablePromise<StoreData> = loadStoreData || Promise.resolve(store.state[opts.apiName][uri])
promise.toJSON = () => '{}' // avoid warning in Nuxt when serializing the complete Vuex store ("Cannot stringify arbitrary non-POJOs Promise")
store.state[opts.apiName][uri]._meta.load = promise

store.commit('setLoadPromise', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you read the comment on line 399? I think I had to do it thisway, otherwise I would run into problems... Change LGTM, but I'm unsure because of that comment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the structure and the comment, i think this should probably only be done once?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants